		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        12/26/2008
 * PROJECT:             MCWEBSITE
 * PURPOSE:             websiteProductCommentBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;
using System.Data;

namespace MCWEBSITE.BUL
{
    public class websiteProductCommentBUL
    {
        public static int Save(websiteProductCommentInfo _websiteProductCommentInfo)
        {
            try
            {
                if (_websiteProductCommentInfo.CommentID == 0)
                {
                    return websiteProductCommentDAL.Insert(_websiteProductCommentInfo);
                }
                else
                {
                    return websiteProductCommentDAL.Update(_websiteProductCommentInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }

        public static int Remove(int _CommentID)
        {
            try
            {
                return websiteProductCommentDAL.Delete(_CommentID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static List<websiteProductCommentInfo> GetAll()
        {
            try
            {
                return websiteProductCommentDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteProductCommentInfo Load(int _CommentID)
        {
            try
            {
                return websiteProductCommentDAL.SelectOne(_CommentID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<websiteProductCommentInfo> Search()
        {
            try
            {
                return websiteProductCommentDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static DataSet SelectByProduct(int ItemId)
        {
            try
            {
                return websiteProductCommentDAL.SelectByProduct(ItemId);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static int GetCountComment(int _ItemID)
        {
            try
            {
                return websiteProductCommentDAL.GetCountComment(_ItemID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }
    }
}

		